KML: Read Polygon/outerBoundaryIs/LinearRing as a track.
authorrobertl <robertl>
Wed, 14 Nov 2007 16:22:51 +0000 (16:22 +0000)
committerrobertl <robertl>
Wed, 14 Nov 2007 16:22:51 +0000 (16:22 +0000)
kml.c

diff --git a/kml.c b/kml.c
index 9060ee9e9b43700e0666c4bb00cb36094c90934d..655e3b91725318e0b504d6ffcef3cfccdb5519d6 100644 (file)
--- a/kml.c
+++ b/kml.c
@@ -142,6 +142,7 @@ xg_tag_mapping kml_map[] = {
        { wpt_coord,    cb_cdata,       "/Placemark/Point/coordinates" },
        { wpt_icon,     cb_cdata,       "/Placemark/Style/Icon/href" },
        { trk_coord,    cb_cdata,       "/Placemark/MultiGeometry/LineString/coordinates" },
+       { trk_coord,    cb_cdata,       "/Placemark/Polygon/outerBoundaryIs/LinearRing/coordinates" },
        { trk_coord,    cb_cdata,       "/Placemark/LineString/coordinates" },
        { NULL,         0,              NULL }
 };
@@ -592,6 +593,12 @@ static void kml_output_point(const waypoint *waypointp, const char *style)
        kml_output_lookat(waypointp);
        kml_output_timestamp(waypointp);
        kml_write_xml(0, "<styleUrl>%s</styleUrl>\n", style);
+#if 0
+       // If we were to try to spin track icon to indication direction
+       // of motion, it might look something like this.  Unfortunately,
+       // doing that causes a huge performance problem in Google Earth.
+       kml_write_xml(0, "<Style><IconStyle><heading>%f</heading></IconStyle></Style>\n", 360 - waypointp->course);
+#endif
        kml_write_xml(1, "<Point>\n");
         if (floating) {
           kml_write_xml(0, "<altitudeMode>absolute</altitudeMode>\n");